package com.codinghero.example.http.router;

import java.io.IOException;

public class RouterSwitchMain {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		
		if (args == null || args.length == 0)
			throw new IllegalArgumentException("0 close, 1 open");
		else if (!args[0].equals("0") && !args[0].equals("1"))
			throw new IllegalArgumentException("0 close, 1 open");
		
		RouterSwitcher switcher = new RouterSwitcher();
		if (args[0].equals("1"))
			System.out.println(switcher.open());
		else
			System.out.println(switcher.close());
	}

}
